import { _decorator, Component, Node, ScrollView, UIRenderer, Mask, math, UITransform } from 'cc';
import { MergeItem } from './MergeItem';
const { ccclass, property } = _decorator;

@ccclass('MergeItemWithCulling')
export class MergeItemWithCulling extends MergeItem {

    levelChildren: Node[][] = [];

    static boundingBox: math.Rect = new math.Rect();

    uiTrans: UITransform;

    getBoundingBox(): math.Rect {
        const rect = MergeItemWithCulling.boundingBox,
            uiTrans = this.uiTrans, contentSize = uiTrans.contentSize, anchorPoint = uiTrans.anchorPoint,
            node = this.node, parent = node.parent;
        rect.set(
            parent.x + node.x - anchorPoint.x * contentSize.width, parent.y + node.y - anchorPoint.y * contentSize.height, contentSize.width, contentSize.height
        )
        return rect;
    }
}


